 package srdb.migration.schema.metadata;
 
 public class DBLink extends DBObject
 {
   private String owner;
   private String name;
   private String userName;
   private String password = "edb";
   private String host;
   private LINKTYPE linkType;
 
   public LINKTYPE getLinkType()
   {
     return this.linkType;
   }
 
   public void setLinkType(LINKTYPE linkType) {
     this.linkType = linkType;
   }
 
   public String getHost() {
     return this.host;
   }
 
   public void setHost(String host) {
     this.host = host;
   }
 
   public String getName() {
     String[] names = this.name.split("\\.");
     if ((names != null) && (names.length > 0))
       return names[0];
     return this.name;
   }
 
   public void setName(String name)
   {
     this.name = name;
   }
 
   public String getOwner() {
     return this.owner;
   }
 
   public void setOwner(String owner) {
     this.owner = owner;
     if (owner.equalsIgnoreCase("public")) {
       setLinkType(LINKTYPE.PUBLIC);
     }
     else
       setLinkType(LINKTYPE.PRIVATE);
   }
 
   public String getPassword() {
     return this.password;
   }
 
   public void setPassword(String password) {
     this.password = password;
   }
 
   public String getUserName() {
     return this.userName;
   }
 
   public void setUserName(String userName) {
     this.userName = userName;
   }
 
   public boolean isValidHost() {
     return this.host.startsWith("//");
   }
 
   public DBObject getParent()
   {
     return null;
   }
 
   public String getSchema()
   {
     return null;
   }
 
   public static enum LINKTYPE
   {
     PUBLIC, 
     PRIVATE;
 
     public String toString()
     {
       String value = null;
       switch (DBLink.LINKTYPE.values()[ordinal()]) {
       case PUBLIC:
         value = "PUBLIC";
         break;
       case PRIVATE:
         value = "";
       }
 
       return value;
     }
   }
 }

/* 

 * 
 */